//
//  HomeURL.swift
//  ParkManage
//
//  Created by Jalon on 9/21/20.
//  Copyright © 2020 diligrp. All rights reserved.
//

import Foundation

enum HomeURL {
    /// 通行证审核
    case passAudit
    /// 价格确认
    case priceConfirmation
    /// 进厅超时
    case enterHallTimeout
    /// 转离场超时
    case departureTimeout
}

extension HomeURL {
    
    var path: String {
        switch self {
        case .passAudit:
            return "navigator://HomeURL/passAudit"
        case .priceConfirmation:
            return "navigator://HomeURL/priceConfirmation"
        case .enterHallTimeout:
            return "navigator://HomeURL/enterHallTimeout"
        case .departureTimeout:
            return "navigator://HomeURL/departureTimeout"
        }
    }
    
    static func initRouter() {
        navigator.register(HomeURL.passAudit.path) { _, _, context in
            let vc = PassAuditViewController()
            vc.type = context as? AuditType
            return vc
        }
        navigator.register(HomeURL.priceConfirmation.path) { _, _, _ in
            let vc = PriceConfirmationViewController()
            return vc
        }
        navigator.register(HomeURL.enterHallTimeout.path) { _, _, _ in
            let vc = EnterHallTimeoutViewController()
            return vc
        }
        navigator.register(HomeURL.departureTimeout.path) { _, _, _ in
            let vc = DepartureTimeoutViewController()
            return vc
        }
    }
}
